package com.zhanglingfei.yuekaoshop.entity;

import lombok.Data;

import java.io.Serializable;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author Shichao.Lu
 * 订单详情表
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "tb_order_detail")
@DynamicInsert
@DynamicUpdate
public class OrderDetail implements Serializable {

	/**
	 * 订单详情id 
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private Long id;

	/**
	 * 订单id
	 */
	@Column(name = "order_id")
	private Long orderId;

	/**
	 * sku商品id
	 */
	@Column(name = "sku_id")
	private Long skuId;

	/**
	 * 购买数量
	 */
	@Column(name = "num")
	private Integer num;

	/**
	 * 商品标题
	 */
	@Column(name = "title")
	private String title;

	/**
	 * 商品动态属性键值集
	 */
	@Column(name = "own_spec")
	private String ownSpec;

	/**
	 * 价格,单位：分
	 */
	@Column(name = "price")
	private Long price;

	/**
	 * 商品图片
	 */
	@Column(name = "image")
	private String image;
}
